<?php
/* 
 * ********* CVS HEADER ********* 
 * 
 * $RCSfile: admhtmlliste.php,v $ 
 * $Date: 2006/04/19 06:36:48 $ 
 * $Revision: 1.3 $ 
 * 
 * ********* CVS HEADER ********* 
 */
include("environnement/$session[environnement]/header.php");
?>
<center>LISTE DES PAGES HTML</center><br>
<table>
 
<?php
	$query="SELECT html.id,html.code,html.titre,groupe.nom AS groupe FROM html,groupe WHERE html.droit=groupe.id";
	if($order=="code"||$order=="")
	{
		$query.=" ORDER BY html.code";
	}
	else if($order=="page")
	{
		$query.=" ORDER BY html.id";
	}
	else if($order=="droit")
	{
		$query.=" ORDER BY groupe.nom";
	}
	if($dir=="down")
	{
		$dir="up";
		$query.=" DESC";
	}
	else
	{
		$dir="down";
		$query.=" ASC";
	}
?>
<tr>
 	<td><?php echo "<a href=\"?op=admhtmlliste&order=page&dir=$dir\">"; ?>page</a></td>
 	<td><?php echo "<a href=\"?op=admhtmlliste&order=code&dir=$dir\">"; ?>code</a></td>
 	<td>titre</td>
 	<td><?php echo "<a href=\"?op=admhtmlliste&order=droit&dir=$dir\">"; ?>droit</a></td>
 	<td>action</td>
 </tr>
<?php
	$result=rportalrequete($query) or rportalerreur($query,"?op=");
	$class="class=\"liste_impaire\"";
	while($row=rportalligne($result))
	{
		echo "<tr $class><td><a name=\"$row[id]\">$row[id]</td>\n";
		echo "<td><a href=\"?op=admhtmlmod&argid=$row[id]\">$row[code]</a></td>\n";
		echo "<td>$row[titre]</td>\n";
		echo "<td>$row[groupe]</td>\n";
		echo "<td><a href=\"?op=html&page=$row[id]\">voir</a> | <a href=\"?op=admhtmlsupp&argid=$row[id]\">supp</a></td>\n";
		echo "</tr>";
		if($class!="class=\"liste_impaire\"")
		{
			$class="class=\"liste_impaire\"";
		}else{
			$class="class=\"liste_paire\"";
		}
	}
?>
</table>
<?php
include("environnement/$session[environnement]/footer.php");
?>